<template>
  <div class="search_container searchArea">
        <el-form 
            :inline="true" 
            :model='search_data' 
            :rules="rules"
            ref="search_data" 
            class="demo-form-inline search-form">
			<!-- <el-form-item label="日期选择:">
				<el-date-picker
				  v-model="search_data.date"
				  type="date"
				  @change='onScreeoutMoney()'
				  placeholder="选择日期">
				</el-date-picker>
			</el-form-item> -->

            <el-form-item class="btnRight">
                <el-button type="primary" size ="mini" icon="view" @click='onBatchDelMoney()'>批量开奖</el-button>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
   import { mapGetters } from 'vuex'

  export default {
      name:'searchItem',
      data(){
          return {
            search_data:{
                date:'',
            },
            rules: {
                name: [
                    { required: true, message: '请输入用户名', trigger: 'blur' },
                ]
            }
          }
      },
       computed:{
        ...mapGetters(['searchBtnDisabled']),

      },
      created(){
      },
      methods:{
          onScreeoutMoney(searchForm){
              this.$refs[searchForm].validate((valid) => {
					if (valid) {
                        this.$store.commit('SET_SEARCH',this.search_data);
                        this.$emit("searchList");
                    }
              })
          },
          onAddMoney(){
              this.$emit("showDialog",'add');
          },
          onBatchDelMoney(){
              this.$emit("onBatchDelMoney");
          }
      }
  }
</script>

<style lang="less" scoped>
    .search_container{
        margin-bottom: 0px;
		.el-form{
			min-width: 200px;
		}
    }
    .btnRight{
        float: right;
        margin-right: 0px !important;
    }
    .searchArea.search_container{
        background:rgba(255,255,255,1);
        border-radius:2px;
        padding: 0;
		margin-bottom: 0;
    }
</style>
